package com.oceansoft.mobile.econsole.survey.service;

import com.oceansoft.mobile.econsole.modules.base.entity.Pager;
import com.oceansoft.mobile.econsole.modules.base.entity.Query;
import com.oceansoft.mobile.econsole.modules.base.entity.Result;
import com.oceansoft.mobile.econsole.survey.entity.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by liujie on 2016/9/1.
 */
public interface ISurveyService {

    Pager<Survey> findSurveyByCondition(Query query);

    List<Survey> findSurveysByCondition(Query query);

    Survey getSurveyById(int id);

    Result saveSurvey(Survey survey) throws Exception;

    Result deleteSurvey(int id) throws Exception;

    Pager<Question> findQuestionByCondition(Query query);

    Question getQuestionById(int id);

    Result saveQuestion(Question question, HttpServletRequest request) throws Exception;

    Result deleteQuestion(int id) throws Exception;

    List<Option> getOptionsByQuestion(Question question);

    List<QuestionExt> getQuestionsBySurvey(Survey survey);

    Result saveAnswers(List<Answer> answerList) throws Exception;
}
